<template>
  <a-modal v-model="visible" :footer="null" title="个推.信息推送" width="40%">
    <a-spin :spinning="confirmSpin">
      <a-form-model
        ref="form"
        :model="configData"
        :rules="rules"
        :label-col="labelCol"
        :wrapper-col="wrapperCol">

        <a-form-model-item label="是否开启" prop="enable">
          <a-switch  v-model="configData.enable" checked-children="开" un-checked-children="关" default-checked :disabled="disable" />
        </a-form-model-item>

        <a-form-model-item label="个推appId" prop="appId">
          <a-input v-model="configData.appId" placeholder="请输入个推appId" :style="{color:'black'}"
                   :disabled="disable"/>
        </a-form-model-item>

        <a-form-model-item label="个推appKey" prop="appKey">
          <a-input v-model="configData.appKey" placeholder="请输入个推appKey" :style="{color:'black'}"
                   :disabled="disable"/>
        </a-form-model-item>


        <a-form-model-item label="个推masterSecret" prop="masterSecret">
          <a-input v-model="configData.masterSecret" placeholder="请输入个推masterSecret" :style="{color:'black'}"
                   :disabled="disable"/>
        </a-form-model-item>


        <a-form-model-item :wrapper-col="{ span: 14, offset: 7 }" v-if="!disable">
          <a-button type="primary" style="width:100px;" @click="onSubmit">
            修改
          </a-button>
          <a-button style="margin-left: 20px;width:100px;" @click="resetForm">
            重置
          </a-button>
        </a-form-model-item>

      </a-form-model>
    </a-spin>
  </a-modal>
</template>
<script>
import {getAction, putAction} from "@/api/manage";
import {BoneCommonMixin} from "@/mixins/BoneCommonMixin";
import {ConfigDictMixins} from "@views/gospel/configCenter/mixins/ConfigDictMixins";

export default {
  name: "GeTuiModal",
  mixins: [BoneCommonMixin, ConfigDictMixins],
  components: {},
  data() {
    return {
      description: "个推.信息推送配置框",
      rules: {
        enable: [
          {required: true, message: '请输入enable', trigger: 'blur'},
        ],
        appKey: [
          {required: true, message: '请输入appKey', trigger: 'blur'},
        ],
        appId: [
          {required: true, message: '请输入appId', trigger: 'blur'},
        ],
        masterSecret: [
          {required: true, message: '请输入masterSecret', trigger: 'blur'},
        ],
      },
      type: "tippushGetui",
      configData: {
        "appId":"",
        "appKey":"",
        "enable":true,
        "masterSecret":"",
        "userType":""
      },
      url: {
        configUpdate: "/config/push",
      },
    }
  },
}
</script>

<style scoped>

</style>